#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

char* my_strstr(char* a,const char* b)
{
	char* A = a;
	char* B = b;

	while (*a)
	{
		a = A;
		b = B;
		while (*a != '\0' && *b != '\0' && *a == *b)
		{

			a++; b++;
		}
		if (*b == '\0')return A;
		A++;
	}
	return NULL;
}

int main()
{
	char a[999] = { 0 }, b[999] = { 0 };

	gets(a);
	gets(b);

	printf("%s", my_strstr(a, b));
	return 0;
}